{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##Private Messages##</span></h2>
</div>
<div class="ag_outerwrap">
	<div class="ag_pms_toolbar">
		<ul class="ag_pms_toolbar">
			<li>
				<a href="{url task=pms page=compose}">
					<img src="{$root_url}img/admin/pms-compose.png" alt="##Compose##" title="##Compose##" />
				</a>
			</li>
			<li>
				<a href="{url task=pms box=0}">
					<img src="{$root_url}img/admin/pms-inbox.png" alt="##Inbox##" title="##Inbox##" />
				</a>
			</li>
			<li>
				<a href="{url task=pms box=1}">
					<img src="{$root_url}img/admin/pms-sent.png" alt="##Sent##" title="##Sent##" />
				</a>
			</li>
		</ul>
	</div>
	<div class="ag_clearer"></div>
</div>

<div class="ag_postlinksTop">
	<div class="ag_inbox">
		<div class="ag_pagelink">
			{include file=agora:include/paginate.tpl}
		</div>
	</div>
</div>
<div class="ag_clearer"></div>
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">{if $box == 0}##Inbox##{else}##Sent##{/if}</span></h2>
</div>
<div class="ag_tablewrap">
	<form method="post" action="{$self_url}">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<thead>
				<tr>
					<th class="ag_leftend">##Status##</th>
					<th class="ag_pms ag_pms_subject">##Subject##</th>
					<th class="ag_pms ag_pms_sender">
					{if $box == 0}
						##Sender##
					{else}
						##Receiver##
					{/if}
					</th>
					<th class="ag_pms ag_pms_date">##Date##</th>
					<th class="ag_pms ag_pms_delete">##Delete##</th>
				</tr>
			</thead>
			<tbody>
				{foreach from=$messages item=message}
				<tr>
					<td class="ag_leftend">
						<div class="{if !$message.showed}ag_new{else}ag_icon{/if}">&nbsp;</div>
					</td>
					<td class="ag_pms ag_pms_subject">
						<a href="{url task=pms page=view id=$message.id}">
							{if !$message.showed}<strong>{/if}{$message.subject|escape}{if !$message.showed}</strong>{/if}
						</a>
					</td>
					<td class="ag_pms ag_pms_sender">
						<span class="ag_byuser">
							<a href="{url task=profile user_id=$message.sender_id}" title="{if $agora_config.o_fullnames_enabled}{$message.name}{else}{$message.sender}{/if}">{if $agora_config.o_fullnames_enabled}{$message.name}{else}{$message.username}{/if}</a>
						</span>
					</td>
					<td class="ag_pms ag_pms_date">
						{$message.posted|agora_date}
					</td>
					<td class="ag_pms ag_pms_delete">
						<input type="checkbox" name="delete_messages[]" value="{$message.id}" />
					</td>
				</tr>
				{foreachelse}
				<tr>
					<td class="ag_pms ag_pms_empty" colspan="5">##No messages##</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<div class="ag_postlinksBottom">
			<div class="ag_inbox">
				<div class="ag_pagelink">
					{include file=agora:include/paginate.tpl}
				</div>
			</div>
		</div>
		<div class="ag_clearer"></div><br />
		<div class="ag_postbuttons">
			<span>
				<input type="hidden" name="page" value="list" />
				<input type="hidden" name="action" value="delete" />
				<input type="hidden" name="box" value="{$box}" />
				<input class="ag_button ag_btn_submit" type="submit" value="##Delete##" title="##Submit##" />
			</span>
		</div>
	</form>
</div>
<div class="ag_forum_separator"></div>